﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SeaButtleMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<SeaBattle.UI.Web.Models.GamePlayModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	GamePlay
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div id="play-panel">
    <table id="play-table">
    <tr>

        <td id="play-info">
        <p><%:Model.StepStatus %></p>
        <p>
            <input type="button" value="Update" onclick="self.location.href='<%:Url.Action("GamePlay","Game") %>';"/>
        </p>
        </td>

        <td id="your-field">
            <p>Your Field</p>
            <table id="table-your">
                
                <% for (int i = 0; i < 10; i++){ %>    
                <tr>
                <% for(int j =0;j<10;j++) { %>       
                <% var Index = i * 10 + j; %>
                <td class="<%: Model.CellClass(Model.realField,i,j) %>" id="real-cell-<%:Index %>" style="cursor: hand">
                </td>
                <%} %>
                </tr>
                <%} %>
            </table>
        </td>

        <td id="opponent-field">
        <p>Opponent Field</p>
            <table id="table-opponent">
                <% for (int i = 0; i < 10; i++){ %>    
                <tr>
                <% for(int j =0;j<10;j++) { %>       
                <% var Index = i * 10 + j; %>
                <td class="<%: Model.CellClass(Model.virtualField,i,j) %>" id="virtual-cell-<%:Index %>" style="cursor: hand">
                    <% if (Model.isYourStep) %>
                    <% if ( Model.CellClass(Model.virtualField,i,j) == "none" ) {%>            
                         <%: Html.ActionLink("*", "Shot", "Game", new { index = Index }, new { })%>
                    <%} %> 
                </td>
                <%} %>
                </tr>
                <%} %>
            </table>
        </td>

    </tr>
    </table>
    </div>

</asp:Content>
